home *** CD-ROM | disk | FTP | other *** search
- Path: globe.indirect.com!fnf
- From: fnf@fishpond.ninemoons.com (Fred Fish)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Free native Amiga PowerPC tools available
- Date: 14 Apr 1996 07:28:20 GMT
- Organization: Cronus
- Message-ID: <4kq9ek$8rf@globe.indirect.com>
- NNTP-Posting-Host: amigalib.com
-
- Just for grins, I decided to kill a couple hours today and try
- building an ADE PowerPC toolchain that runs native on the Amiga and
- generates AmigaDOS executable files containing PowerPC code rather
- than m68k code. This includes the C, C++, and Objective C compilers,
- the assembler, the linker, and various other utilities like nm, ar,
- ranlib, etc.
-
- Since I'd already done this once before as a cross compiler under
- linux, things actually went quite smoothly. Note that like the m68k
- toolchain, the ppc toolchain does not yet use AmigaDOS hunk format
- object files. For various reasons, it uses ELF rather than the a.out
- format used in the m68k toolchain. Progress is being made though on
- using AmigaDOS hunk format for the default object file format in the
- m68k toolchain, and that will carry over quite easily to the ppc
- toolchain.
-
- Basically building and installing a ppc toolchain from the ADE 960412
- binutils and gcc just involves just giving the following commands:
-
- mkdir /build/binutils /build/gcc
- cd /build/binutils
- sh /ade-src/fsf/binutils/configure -v \
- --host=m68k-unknown-amigados \
- --target=ppc-unknown-amigados
- make install
- cd /build/gcc
- sh /ade-src/fsf/gcc/configure -v \
- --host=m68k-unknown-amigados \
- --target=ppc-unknown-amigados
- make install
-
- In practice, I had to make a couple of quick hacks to the gcc Makefile
- to get libgcc.a built, and apply a minor fix to binutils to get gas to
- compile. If anyone wants these fixes they can email me.
-
- I tested the toolchain by compiling and linking a simple C program
- that referenced no external functions (since there is no runtime
- library yet), using something like:
-
- ppc-unknown-amigados-gcc -O2 -S myfile.c
- ppc-unknown-amigados-gcc -c myfile.s
- ppc-unknown-amigados-gcc -nostdlib -o myfile myfile.o
-
- I did it in three steps simply so I could examine the intermediate
- files, since I was curious about the assembly code and the structure
- of the ELF object file. I did notice that some of the tools, like nm,
- fail to recognize the AmigaDOS hunk executable file format, but that
- is a bug I don't have time to chase today.
-
- A compressed tar archive of the binary ppc toolchain is available in
- pub/ade/updates on ftp.ninemoons.com, as ppctools.tgz. It should be
- used basically just for educational purposes, but if you happen to
- have a PowerPC board in your Amiga and can get it to execute something
- generated by these tools, I'd certainly like to hear about it. Or
- better yet, send *me* one so I can support you. :-)
-
- To install the tools, assuming you have at least some of the other
- ADE tools installed (like gzip, tar, ixemul.library, gcc, etc), just
- do:
-
- cd gnu:
- tar -xvzf path:ppctools.tgz
-
- If anyone feels really ambitious, they can try building a cross gdb
- that includes the ppc simulator and run Amiga ppc executables inside
- the simulator.
-
- Oh yes, if you find it tedious to type ppc-unknown-amigados-gcc every
- time you want to use the compiler, just link or copy it to some other
- name, like ppcgcc.
-
- -Fred Fish (fnf@ninemoons.com)
- 13-Apr-96
- --
- CRONUS -- 1840 E. Warner Road #105-265 -- Tempe, AZ 85284 -- USA
- Voice: (800) 804-0833 -- (602) 491-0442 -- FAX: (602) 491-0048
- Email: info@ninemoons.com -- WWW: http://www.ninemoons.com
- Ftp site: ftp.ninemoons.com
-
-